function w = wallFollowRot(minSide, rightWallFollow)
  k = 0.6;
  wMax = pi / 4;
  wMin = 0.13;
  t = 0.35;
  w = k * (minSide - t);
  if (rightWallFollow)
    w = -w;
  end
  w = w .* (abs(w) >= wMin) + -wMin .* (-wMin < w & w <= 0) + wMin .* (0 < w & w < wMin);
  w = w .* (-wMax < w & w < wMax) + -wMax .* (w < -wMax) + wMax .* (w > wMax);
end
